package Controller;

import java.awt.event.ActionListener;

import Model.ModelClass;
import View.ViewClass;

public class ControllerClass implements ActionListener {
	ModelClass model;
	ViewClass view;

	public ControllerClass() {	
//		System.out.println ("Controller()");
	} //Controller()
	
	//invoked when a button is pressed
	public void actionPerformed(java.awt.event.ActionEvent e){
		if (e.getActionCommand().toString() == "Button 2") {
			System.out.println("hello");
		}
		else {
			System.out.println("good bye");
		}
		model.incrementValue();
	} //actionPerformed()
	
	//Joe I should be able to add any model/view with the correct API
	//but here I can only add Model/View
	public void addModel(ModelClass m){
//		System.out.println("Controller: adding model");
		this.model = m;
	} //addModel()
	
	public void addView(ViewClass v){
//		System.out.println("Controller: adding view");
		this.view = v;
	} //addView()
	
	public void initModel(int x){
		model.setValue(x);
	} //initModel()
}
